package jml.defaultimple.util;

import java.util.Comparator;

public class Sort
{
	public static <T> void sort(T[] arr,Comparator<T> c)
	{
		boolean ordenado = false;
		while( !ordenado )
		{
			ordenado = true;
			for(int i=0; i<arr.length-1;i++)
			{
				if( c.compare(arr[i], arr[i+1])>0 )
				{
					T aux = arr[i];
					arr[i]=arr[i+1];
					arr[i+1]=aux;
					ordenado = false;
				}
			}
		}
	}
}
